//
//  MeUserCustomCell.m
//  HTHappySale
//
//  Created by 创维海通 on 2017/9/21.
//  Copyright © 2017年 zxyywy. All rights reserved.
//

#import "MeUserCustomCell.h"
@interface MeUserCustomCell()
{
    NSArray *sellArr;
    NSArray *messageArr;
}
@property (strong, nonatomic) IBOutlet UILabel *title;
@property (strong, nonatomic) IBOutlet UILabel *explain;

@end

@implementation MeUserCustomCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    sellArr = @[@"昵称",@"区域",@"姓名",@"手机号",@"人物属性",@"我的销售经理"];
    messageArr = @[@"昵称",@"区域",@"姓名",@"手机号",@"人物属性",@"我的二维码"];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)configureCell:(UserInfoModel *)model withRole:(int)role withAtIndex:(NSInteger)index;
{
    if(role == 3)
    {
        _title.text = sellArr[index - 1];
    }else{
        _title.text = messageArr[index - 1];
    }
    if(index == 1){
        _explain.text = model.nickname;
    }else if (index == 2){
        _explain.text = model.regionName;
    }else if (index == 3){
        _explain.text = model.realName;
    }else if (index == 4){
        _explain.text = model.mobile;
    }else if (index == 5){
        if(role == 0)
        {
            _title.text = @"我的销售经理";
            _explain.text = @"扫一扫成为销售员";
        }else if (role == 1) {
            _explain.text = @"商户";
        }else if (role == 2)
        {
            _explain.text = @"销售经理";
        }else if (role == 3) {
            _title.text = @"人物属性";
            _explain.text = @"销售员";
        }
    }else if (index == 6){
        if (role == 2) {
            _explain.hidden = YES;
        }else if (role == 3)
        {
            _title.text = @"我的销售经理";
            _explain.text = model.managerName;
        }
        
    }
    
}

@end
